package cn.com.sp.demo.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer  {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 自定义拦截器，添加拦截路径和排除拦截路径
		//InterceptorRegistration addInterceptor = registry.addInterceptor(new FixInterceptor());
		registry.addInterceptor(new FixInterceptor()).addPathPatterns("/**").excludePathPatterns("/test/**");
	}
}
